﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections;
using DAO;
using DTO;
namespace BUS
{
     public class MayBayBUS
    {
         protected MayBayDAO dao = new MayBayDAO();
         public DataTable layThongTinMayBay()
         {
             return dao.layThongTinMayBay();
         }
         public DataTable layThongTinLishSuMayBay(string soHieuMayBay)
         {
              return dao.layThongTinLishSuMayBay(soHieuMayBay);
         }
         public int capNhatMayBay(string maMayBay)
         {
             return dao.capNhatMayBay(maMayBay);
         }
         public int capNhatMayBay(MayBayDTO dto, int soChoHang1, int soChoHang2,int soChoHang3)
         {
             dto.NgayNhap = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(dto.NgayNhap));
             return dao.capNhatMayBay(dto,soChoHang1,soChoHang2,soChoHang3);
         }
         public int themMayBay(MayBayDTO dto, int soChoHang1, int soChoHang2, int soChoHang3)
         {
             dto.NgayNhap = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(dto.NgayNhap));
             return dao.themMayBay(dto,soChoHang1,soChoHang2,soChoHang3);
         }
         public bool kiemTraSoHieu(string soHieu)
         {
             return dao.kiemTraSoHieu(soHieu);
         }
         public DataTable layThongTinSoHieuMayBay()
         {
             return dao.layThongTinSoHieuMayBay();
         }
         public DataTable layThongTinSoHieuMayBay(string ngayDi, int changBay)
         {
             return dao.layThongTinSoHieuMayBay(ngayDi, changBay);
         }
         public int themLichSuBay(string soHieuMayBay, string tuNgay, string denNgay, string noiDung, int tinhTrangMayBay, string ViTri)
         {
             tuNgay = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(tuNgay));
             denNgay = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(denNgay));
             return dao.themLichSuBay(soHieuMayBay, tuNgay, denNgay, noiDung, tinhTrangMayBay, ViTri);
         }
         public DataTable laySoCho(string soHieuMayBay)
         {
             return dao.laySoCho(soHieuMayBay);
         }
    }
}
